/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "islandgroup")
@NamedQueries({
    @NamedQuery(name = "Islandgroup.findAll", query = "SELECT i FROM Islandgroup i"),
    @NamedQuery(name = "Islandgroup.findByIdislandgroup", query = "SELECT i FROM Islandgroup i WHERE i.idislandgroup = :idislandgroup"),
    @NamedQuery(name = "Islandgroup.findByIslandgroup", query = "SELECT i FROM Islandgroup i WHERE i.islandgroup = :islandgroup")})
public class Islandgroup implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idislandgroup")
    private Integer idislandgroup;
    @Basic(optional = false)
    @Column(name = "islandgroup")
    private String islandgroup;
    @OneToMany(mappedBy = "islandgroup", fetch = FetchType.LAZY)
    private List<Localityelement> localityelementList;

    public Islandgroup() {
    }

    public Islandgroup(Integer idislandgroup) {
        this.idislandgroup = idislandgroup;
    }

    public Islandgroup(Integer idislandgroup, String islandgroup) {
        this.idislandgroup = idislandgroup;
        this.islandgroup = islandgroup;
    }

    public Integer getIdislandgroup() {
        return idislandgroup;
    }

    public void setIdislandgroup(Integer idislandgroup) {
        this.idislandgroup = idislandgroup;
    }

    public String getIslandgroup() {
        return islandgroup;
    }

    public void setIslandgroup(String islandgroup) {
        this.islandgroup = islandgroup;
    }

    public List<Localityelement> getLocalityelementList() {
        return localityelementList;
    }

    public void setLocalityelementList(List<Localityelement> localityelementList) {
        this.localityelementList = localityelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idislandgroup != null ? idislandgroup.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Islandgroup)) {
            return false;
        }
        Islandgroup other = (Islandgroup) object;
        if ((this.idislandgroup == null && other.idislandgroup != null) || (this.idislandgroup != null && !this.idislandgroup.equals(other.idislandgroup))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Islandgroup[idislandgroup=" + idislandgroup + "]";
    }

}
